package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordPhotoMapper;
import com.letian.record.domain.RecordPhoto;
import com.letian.record.service.IRecordPhotoService;

/**
 * 记录照片Service业务层处理
 * 
 * @author bmz
 * @date 2023-11-06
 */
@Service
public class RecordPhotoServiceImpl implements IRecordPhotoService 
{
    @Autowired
    private RecordPhotoMapper recordPhotoMapper;

    /**
     * 查询记录照片
     * 
     * @param photoId 记录照片主键
     * @return 记录照片
     */
    @Override
    public RecordPhoto selectRecordPhotoByPhotoId(Long photoId)
    {
        return recordPhotoMapper.selectRecordPhotoByPhotoId(photoId);
    }

    /**
     * 查询记录照片列表
     * 
     * @param recordPhoto 记录照片
     * @return 记录照片
     */
    @Override
    public List<RecordPhoto> selectRecordPhotoList(RecordPhoto recordPhoto)
    {
        return recordPhotoMapper.selectRecordPhotoList(recordPhoto);
    }

    /**
     * 新增记录照片
     * 
     * @param recordPhoto 记录照片
     * @return 结果
     */
    @Override
    public int insertRecordPhoto(RecordPhoto recordPhoto)
    {
        recordPhoto.setCreateTime(DateUtils.getNowDate());
        return recordPhotoMapper.insertRecordPhoto(recordPhoto);
    }

    /**
     * 修改记录照片
     * 
     * @param recordPhoto 记录照片
     * @return 结果
     */
    @Override
    public int updateRecordPhoto(RecordPhoto recordPhoto)
    {
        recordPhoto.setUpdateTime(DateUtils.getNowDate());
        return recordPhotoMapper.updateRecordPhoto(recordPhoto);
    }

    /**
     * 批量删除记录照片
     * 
     * @param photoIds 需要删除的记录照片主键
     * @return 结果
     */
    @Override
    public int deleteRecordPhotoByPhotoIds(Long[] photoIds)
    {
        return recordPhotoMapper.deleteRecordPhotoByPhotoIds(photoIds);
    }

    /**
     * 删除记录照片信息
     * 
     * @param photoId 记录照片主键
     * @return 结果
     */
    @Override
    public int deleteRecordPhotoByPhotoId(Long photoId)
    {
        return recordPhotoMapper.deleteRecordPhotoByPhotoId(photoId);
    }
}
